﻿using University.Workshop.Business;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace University.Workshop.Tests
{
    
    
    /// <summary>
    ///This is a test class for ValidateFieldsTest and is intended
    ///to contain all ValidateFieldsTest Unit Tests
    ///</summary>
    [TestClass()]
    public class ValidateFieldsTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion

        /// <summary>
        ///A test for FirstNameValidation
        ///</summary>
        [TestMethod()]
        public void FirstNameValidationTest()
        {
            string firstName = "victor hugo"; // TODO: Initialize to an appropriate value
            string expected = null; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.FirstNameValidation(firstName);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual("Error First Name", actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test error for FirstNameValidation
        ///</summary>
        [TestMethod()]
        public void ErrorFirstNameValidationTest()
        {
            string firstName = "victor23423"; // TODO: Initialize to an appropriate value
            string expected = "Error First Name"; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.FirstNameValidation(firstName);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual(null, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for AddressValidation
        ///</summary>
        [TestMethod()]
        public void AddressValidationTest()
        {
            string address = "america 543"; // TODO: Initialize to an appropriate value
            string expected = null; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.AddressValidation(address);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual("Error Address",actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test error for AddressValidation
        ///</summary>
        [TestMethod()]
        public void ErrorAddressValidationTest()
        {
            string address = "america @@."; // TODO: Initialize to an appropriate value
            string expected = "Error Address"; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.AddressValidation(address);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual(null, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for CIValidation
        ///</summary>
        [TestMethod()]
        public void CIValidationTest()
        {
            string ci = "6634567"; // TODO: Initialize to an appropriate value
            string expected = null; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.CIValidation(ci);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual("Error CI", actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test error for CIValidation
        ///</summary>
        [TestMethod()]
        public void ErrorCIValidationTest()
        {
            string ci = "6634qwe"; // TODO: Initialize to an appropriate value
            string expected = "Error CI"; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.CIValidation(ci);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual(null, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for CellPhoneValidation
        ///</summary>
        [TestMethod()]
        public void CellPhoneValidationTest()
        {
            string cellPhone = "72797654"; // TODO: Initialize to an appropriate value
            string expected = null; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.CellPhoneValidation(cellPhone);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual("Error Cell Phone", actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test error for CellPhoneValidation
        ///</summary>
        [TestMethod()]
        public void ErrorCellPhoneValidationTest()
        {
            string cellPhone = "7279765p"; // TODO: Initialize to an appropriate value
            string expected = "Error Cell Phone"; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.CellPhoneValidation(cellPhone);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual(null, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for ConfirmPasswordValidation
        ///</summary>
        [TestMethod()]
        public void ConfirmPasswordValidationTest()
        {
            string confirmPassword = "victor123"; // TODO: Initialize to an appropriate value
            string expected = null; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.ConfirmPasswordValidation(confirmPassword);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual("Error Confirm Password", actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test error for ConfirmPasswordValidation
        ///</summary>
        [TestMethod()]
        public void ErrorConfirmPasswordValidationTest()
        {
            string confirmPassword = "vict$"; // TODO: Initialize to an appropriate value
            string expected = "Error Password"; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.ConfirmPasswordValidation(confirmPassword);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual(null, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for EmailValidation
        ///</summary>
        [TestMethod()]
        public void EmailValidationTest()
        {
            string email = "victor_vhpq@hotmail.com"; // TODO: Initialize to an appropriate value
            string expected = null; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.EmailValidation(email);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual("Error Email", actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test error for EmailValidation
        ///</summary>
        [TestMethod()]
        public void ErrorEmailValidationTest()
        {
            string email = "victor_vhpqhotmail.com"; // TODO: Initialize to an appropriate value
            string expected = "Error Email"; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.EmailValidation(email);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual(null, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for LastNameValidation
        ///</summary>
        [TestMethod()]
        public void LastNameValidationTest()
        {
            string lastName = "penia"; // TODO: Initialize to an appropriate value
            string expected = null; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.LastNameValidation(lastName);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual("Error Last Name",actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test error for LastNameValidation
        ///</summary>
        [TestMethod()]
        public void ErrorLastNameValidationTest()
        {
            string lastName = "penia123"; // TODO: Initialize to an appropriate value
            string expected = "Error Last Name"; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.LastNameValidation(lastName);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual(null, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test for PasswordValidation
        ///</summary>
        [TestMethod()]
        public void PasswordValidationTest()
        {
            string password = "victor123"; // TODO: Initialize to an appropriate value
            string expected = null; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.PasswordValidation(password);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual("Error Password", actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test error for PasswordValidation
        ///</summary>
        [TestMethod()]
        public void ErrorPasswordValidationTest()
        {
            string password = "vic%&"; // TODO: Initialize to an appropriate value
            string expected = "Error Password"; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.PasswordValidation(password);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual(null, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for PhoneValidation
        ///</summary>
        [TestMethod()]
        public void PhoneValidationTest()
        {
            string phone = "4456744"; // TODO: Initialize to an appropriate value
            string expected = null; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.PhoneValidation(phone);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual("Error phone", actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test error for PhoneValidation
        ///</summary>
        [TestMethod()]
        public void ErrorPhoneValidationTest()
        {
            string phone = "44567p"; // TODO: Initialize to an appropriate value
            string expected = "Error phone"; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.PhoneValidation(phone);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual(null, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for UserNameValidation
        ///</summary>
        [TestMethod()]
        public void UserNameValidationTest()
        {
            string userName = "victorPenia"; // TODO: Initialize to an appropriate value
            string expected = null; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.UserNameValidation(userName);
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test for UserNameValidation and UserExists
        ///</summary>
        [TestMethod()]
        public void UserNameExistsValidationTest()
        {
            string userName = "victor"; // TODO: Initialize to an appropriate value
            string expected = "the user already exists"; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.UserNameValidation(userName);
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test error for UserNameValidation
        ///</summary>
        [TestMethod()]
        public void ErrorUserNameValidationTest()
        {
            string userName = "victo$$&"; // TODO: Initialize to an appropriate value
            string expected = "Error User Name"; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.UserNameValidation(userName);            
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual(null,actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test for ValidatingFieldsNewUser
        ///</summary>
        [TestMethod()]
        public void ValidatingFieldsNewUserTest()
        {            
            bool expected = true; // TODO: Initialize to an appropriate value
            string ci = ValidateFields.CIValidation("3455987");
            string firstName = ValidateFields.FirstNameValidation("juan");
            string lastName = ValidateFields.LastNameValidation("bastos");
            string address = ValidateFields.AddressValidation("america oeste");
            string cellPhone = ValidateFields.CellPhoneValidation("76549876");
            string phone = ValidateFields.PhoneValidation("4445345");
            string email = ValidateFields.EmailValidation("juan@hotmail.com");
            string userName = ValidateFields.UserNameValidation("juan");
            string password = ValidateFields.PasswordValidation("juan12345");
            string confirmPassword = ValidateFields.ConfirmPasswordValidation("juan12345");
            bool actual;
            actual = ValidateFields.ValidatingFieldsNewUser();
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test error for ValidatingFieldsNewUser
        ///</summary>
        [TestMethod()]
        public void ErrorValidatingFieldsNewUserTest()
        {
            bool expected = false; // TODO: Initialize to an appropriate value
            string ci = ValidateFields.CIValidation("34559uyt");
            string firstName = ValidateFields.FirstNameValidation("juan123");
            bool actual;
            actual = ValidateFields.ValidatingFieldsNewUser();
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for NameValidation
        ///</summary>
        [TestMethod()]
        public void NameValidationTest()
        {
            string name = "Medicament"; // TODO: Initialize to an appropriate value
            string expected = null; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.NameValidation(name);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual("Error Name",actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test error for NameValidation
        ///</summary>
        [TestMethod()]
        public void ErrorNameValidationTest()
        {
            string name = "Medi123"; // TODO: Initialize to an appropriate value
            string expected = "Error: No permit numbers, or special characters. This field only allows letters."; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.NameValidation(name);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual(null,actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test error for ValidatingFieldsChangePassword
        ///</summary>
        [TestMethod()]
        public void ErrorValidatingFieldsChangePasswordTest()
        {
            bool expected = false; // TODO: Initialize to an appropriate value
            string password = ValidateFields.PasswordValidation("vic1");
            string confirmPassword = ValidateFields.ConfirmPasswordValidation("vic1");
            bool actual;
            actual = ValidateFields.ValidatingFieldsChangePassword();
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test for ValidatingFieldsNewPatient
        ///</summary>
        [TestMethod()]
        public void ValidatingFieldsNewPatientTest()
        {
            bool expected = true; // TODO: Initialize to an appropriate value
            string ci = ValidateFields.CIValidation("7834506");
            string firstName = ValidateFields.FirstNameValidation("victor");
            string LastName = ValidateFields.LastNameValidation("Penia");
            string cellPhone = ValidateFields.CellPhoneValidation("72654467");
            string phone = ValidateFields.PhoneValidation("4674444");
            string email = ValidateFields.EmailValidation("victor@hotmail.com");
            bool actual;
            actual = ValidateFields.ValidatingFieldsNewPatient();
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test error for ValidatingFieldsNewPatient
        ///</summary>
        [TestMethod()]
        public void ErrorValidatingFieldsNewPatientTest()
        {
            bool expected = false; // TODO: Initialize to an appropriate value
            string ci = ValidateFields.CIValidation("7834ptq");
            string firstName = ValidateFields.FirstNameValidation("victor67");
            string LastName = ValidateFields.LastNameValidation("Penia");
            string cellPhone = ValidateFields.CellPhoneValidation("72654467");
            string phone = ValidateFields.PhoneValidation("4674444");
            string email = ValidateFields.EmailValidation("victorhotmail.com");            
            bool actual;
            actual = ValidateFields.ValidatingFieldsNewPatient();
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test for ValidatingFieldsChangePassword
        ///</summary>
        [TestMethod()]
        public void ValidatingFieldsChangePasswordTest()
        {
            bool expected = true; // TODO: Initialize to an appropriate value
            string password = ValidateFields.PasswordValidation("victor123");
            string confirmPassword = ValidateFields.ConfirmPasswordValidation("victor123");
            bool actual;
            actual = ValidateFields.ValidatingFieldsChangePassword();
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test for SearchFieldValidation
        ///</summary>
        [TestMethod()]
        public void SearchFieldValidationTest()
        {
            string search = "juan manuel"; // TODO: Initialize to an appropriate value
            bool expected = true; // TODO: Initialize to an appropriate value
            bool actual;
            actual = ValidateFields.SearchFieldValidation(search);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual(false, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        ///A test error for SearchFieldValidation
        ///</summary>
        [TestMethod()]
        public void ErrorSearchFieldValidationTest()
        {
            string search = "juan:=$manuel"; // TODO: Initialize to an appropriate value
            bool expected = false; // TODO: Initialize to an appropriate value
            bool actual;
            actual = ValidateFields.SearchFieldValidation(search);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual(true,actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for NumbersFloat
        ///</summary>
        [TestMethod()]
        public void NumbersFloatTest()
        {
            string number = "7.5"; // TODO: Initialize to an appropriate value
            string expected = null; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.NumbersFloat(number);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual("Error Numbers", actual);
        }

        /// <summary>
        ///A test for error NumbersFloat
        ///</summary>
        [TestMethod()]
        public void NumbersFloatErrorTest()
        {
            string number = "a"; // TODO: Initialize to an appropriate value
            string expected = "Error: Unable to permiter letters or special characters. This field only allows numbers."; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.NumbersFloat(number);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual(null, actual);
        }

        /// <summary>
        ///A test for NumbersInt
        ///</summary>
        [TestMethod()]
        public void NumbersIntTest()
        {
            string number = "213"; // TODO: Initialize to an appropriate value
            string expected = null; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.NumbersInt(number);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual("Error Numbers",actual);
        }
        /// <summary>
        ///A test for error NumbersInt
        ///</summary>
        [TestMethod()]
        public void NumbersIntErrorTest()
        {
            string number = "21asd"; // TODO: Initialize to an appropriate value
            string expected = "Error: Unable to permiter letters or special characters. This field only allows numbers."; // TODO: Initialize to an appropriate value
            string actual;
            actual = ValidateFields.NumbersInt(number);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual(null, actual);
        }
        /// <summary>
        ///A test for ValidateNumberFields
        ///</summary>
        [TestMethod()]
        public void ValidateNumberFieldsTest()
        {
            bool expected = true; // TODO: Initialize to an appropriate value
            ValidateFields.NumbersFloat("1.2");
            ValidateFields.NumbersInt("12");
            bool actual;
            actual = ValidateFields.ValidateNumberFields();
            Assert.AreEqual(expected, actual);            
        }

        /// <summary>
        ///A test for error ValidateNumberFields
        ///</summary>
        [TestMethod()]
        public void ValidateNumberFieldsErrorTest()
        {
            bool expected = false; // TODO: Initialize to an appropriate value            
            ValidateFields.NumbersInt("12a");
            bool actual;
            actual = ValidateFields.ValidateNumberFields();
            Assert.AreEqual(expected, actual);            
        }
    }
}
